package com.timguan.render.dao.manager.cms;

import com.timguan.render.dao.domain.cms.CmsDatalistDO;
import com.timguan.render.dao.persistence.cms.CmsDatalistDOMapper;

import javax.annotation.Resource;
import java.util.Date;

/**
 * Created by guankaiqiang on 2015/3/20.
 */
public class CmsDataListManagerImpl {
    @Resource
    private CmsDatalistDOMapper cmsDatalistDOMapper;

    public int insert(CmsDatalistDO record) {
        int id = 0;
        if (record == null) {
            return id;
        }
        Date now = new Date();
        record.setGmtCreate(now);
        record.setGmtModified(now);
        record.setIsDelete(0);
        cmsDatalistDOMapper.insert(record);
        return record != null ? record.getId() : 0;
    }

    public CmsDatalistDO selectByPrimaryKey(int id) {
        return cmsDatalistDOMapper.selectByPrimaryKey(id);
    }

}
